﻿@using Service.Infrastructure.Model
@{
    ViewBag.Title = "用户访问日志";
    var list = (List<UserLogModel>)TempData["Data"];
}
@section HeadPlugin {
    <style type="text/css">
        div.dataTables_length label {
            float: left;
            text-align: left;
        }

        .content-detail {
            font-size: 12px;
            background-color: darkseagreen;
            display: none;
        }
    </style>
}

<div class="portlet box blue">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-globe"></i>用户访问浏览记录
        </div>
        <div class="tools">
            <a href="javascript:;" class="reload"></a>
            <a href="javascript:;" class="remove"></a>
        </div>
    </div>
    <div class="portlet-body">
        <table class="table table-bordered table-hover dataTable">
            <thead>
                <tr>
                    <th></th>
                    <th>Ip</th>
                    <th>Browser</th>
                    <th>HttpMethod</th>
                    <th>Url</th>
                    <th>Platform</th>
                    <th>VisitTime</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var obj in list)
                {
                    
                    <tr>
                        <td><span class="row-details row-details-close" onclick="show(this)" /></td>
                        <td>@obj.Ip</td>
                        <td>@obj.Browser</td>
                        <td>@obj.HttpMethod</td>
                        <td>@obj.VisitPath</td>
                        <th>@obj.Platform</th>
                        <td>@obj.VisitTime</td>
                    </tr>
                    <tr class="content-detail"><td colspan="7">@obj.OtherInfo</td></tr>
                    
                }
            </tbody>
        </table>

    </div>
</div>
@section FootPlugin{

    <script type="text/javascript">

        function show(obj) {

            var d = $(obj).parent().parent().next().filter(".content-detail").filter(":first");
            if (d.is(":hidden")) {
                d.show("slow");
                $(obj).attr("class", "row-details row-details-open");
            } else {
                d.hide();
                $(obj).attr("class", "row-details row-details-close");
            }

        }

        function refresh() {

        }

    </script>
}

